package com.ww.learn.oop.companions

class MyClass {
    /**
     * 伴生对象
     * 类似Java静态方法
     */
    companion object Factory {
        fun create(): MyClass = MyClass()
    }
}

fun main() {
    val myClass = MyClass.create()
    println(myClass)
}